package com.hs.srm.admin.modules.pricemanagement.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.hs.srm.admin.modules.pricemanagement.entity.EssentialInformationEntity;
import com.hs.srm.admin.modules.pricemanagement.entity.InquiryQuotationEntity;
import com.hs.srm.admin.modules.pricemanagement.service.EssentialInformationService;
import com.hs.srm.admin.modules.pricemanagement.vo.EssentialInformationVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import java.util.List;
import java.util.Map;


/**
 * @author yanfei
 * @date 2019年5月7日
 * <p>
 * SAP 信息记录维护信息
 */
public interface EssentialInformationDao extends BaseMapper<EssentialInformationEntity> {
    boolean insertEssntiaInfo(EssentialInformationService essentialInformationService);

    boolean insertInquiryQuoToEssntiaInfo(InquiryQuotationEntity inquiryQuotationEntity);

    EssentialInformationEntity findByNo(@Param("vendorCode") String vendorCode, @Param("factory") String factory, @Param("materialCode") String materialCode,@Param("classify") String classify);

    List<EssentialInformationVO> findByNos(@Param("factory") String factory, @Param("materialCode") String materialCode, @Param("pkId") String pkId);

    List<EssentialInformationVO> simplfindByNos(@Param("factory") String factory, @Param("materialCode") String materialCode, @Param("pkId") String pkId);


    List<EssentialInformationVO> findByEssentialInforma(@Param("factory") String factory, @Param("materialCode") String materialCode);

    void update(@Param("vendorCode") String vendorCode, @Param("factory") String factory, @Param("materialCode") String materialCode, @Param("quotationId")String quotationId);

    //分页查询数据
    public List<EssentialInformationEntity> selectDetailPage(RowBounds rowBounds,
                                                             @Param("ew") Wrapper<EssentialInformationEntity> wrapper, @Param("params") Map<String, Object> params);

    //根据供应商编码和itemID查找数据
    EssentialInformationVO findByCodeItemId(String sgId, String itemId);
}
